# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=diffstat
pkgver=1.58
pkgrel=1
pkgdesc="Display a histogram of diff changes"
arch=('i686' 'x86_64')
url="http://invisible-island.net/diffstat"
depends=('msys2-runtime')
groups=('base-devel')
license=('MIT')
source=("ftp://invisible-island.net/${pkgname}/${pkgname}-${pkgver}.tgz"
    diffstat-1.58-msys2.patch)
md5sums=('6d6e13f7dcfe4db5da65c5175260ea47'
         'a3378b96b375f922c76829dc2b58202f')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  patch -p1 -i ${srcdir}/diffstat-1.58-msys2.patch
}

build () {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --build=${CHOST} \
    --prefix=/usr \
    --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR=${pkgdir}/ install
  install -Dm644 package/debian/copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
